package com.example.pagingdemo.viewmodel;

import androidx.lifecycle.MutableLiveData;
import androidx.paging.DataSource;

import com.example.pagingdemo.bean.Book;


/**
 * @author: njb
 * @date: 2022/9/18 21:47
 * @desc:
 */
public class BookFactory extends DataSource.Factory<Integer, Book> {
    private MutableLiveData<BookDataSource> mSourceLiveData =
            new MutableLiveData<>();

    @Override
    public DataSource<Integer, Book> create() {
        BookDataSource concertDataSource = new BookDataSource();
        mSourceLiveData.postValue(concertDataSource);
        return concertDataSource;
    }

}
